﻿/*  ----------------------------------------------------------------------------
 *  Author:
 *  Chandra Shekhar Tripathi
 *  ----------------------------------------------------------------------------
 *  Product Name:
 *  DbDocumenter
 *  ----------------------------------------------------------------------------
 *  Year:
 *  2009
 *  ----------------------------------------------------------------------------
 *  File:
 *  UCModalPopup.xaml.cs
 *  ----------------------------------------------------------------------------
 */
namespace DBDocumenter.UserControls
{
    using System.Windows;
    using System.Windows.Controls;
    using System.Threading;
    using DBDocumenter.Resources;

    /// <summary>
    /// Interaction logic for UCModalPopup.xaml
    /// </summary>
    public partial class UCModalPopup : UserControl
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="UCModalPopup"/> class.
        /// </summary>
        public UCModalPopup()
        {
            InitializeComponent();
        }

        #endregion Constructors

        #region Methods

        /// <summary>
        /// Sets the status.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="progressBarValue">The progress bar value.</param>
        public void SetStatus(string message, int progressBarValue)
        {
            if (progressBarValue.Equals(0))
            {
                rtbUserMessage.Text = message;
            }

            rtbUserMessage.Text = rtbUserMessage.Text  + message;
            pbWait.Value = progressBarValue;

            if (progressBarValue.Equals(100))
            {
                MessageBox.Show(PLResources.Documentation_is_generated_please_refer_to_Index_file);
            }
        }

        #endregion Methods
    }
}